package Person.views;

import Person.Base.BaseRangeException;
import Person.Base.State;
import Person.models.BaseClass;
import Person.models.Cat;
import Person.models.Dog;

public class NewObjet {
    public static BaseClass CreateObject(int TypeValue) throws BaseRangeException {
        if(TypeValue==0){
            return new Cat();
        }else if(TypeValue==1){
            return new Dog();
        }else{
            throw new BaseRangeException(State.InputValueError);
        }
    }
}
